home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / CBOOK110 / README.TXT < prev    next >
Text File  |  1993-09-21  |  12KB  |  352 lines

  1. How to create your own cookbooks |
  2.                  |
  3. (c) Andrew Brown, September 1993 |
  4. ---------------------------------+
  5.  
  6.  
  7. INTRODUCTION
  8. ------------
  9. Cookbook Manager for Windows v1.10 introduced a feature that allows
  10. users to create their own cookbooks for viewing with Cookbook Manager.
  11. This document describes how to use the MAKEBOOK program. Please note
  12. that MAKEBOOK is a DOS utility, not a Windows program -- although it
  13. works quite happily in a Windows DOS session.
  14.  
  15.  
  16.                BEFORE YOU START
  17.                ----------------
  18.  
  19. Before you attempt to create your own cookbook, there is one
  20. initialisation step that you should perform.
  21.  
  22. In the MAKEBOOK directory, you will find a program file called
  23. MAKEBOOK.EXE. This file should be copied to a directory contained
  24. within your PATH environment variable, such as \DOS. The reason for
  25. this step is that you will be working on your new cookbook in a
  26. sub-directory created especially for that purpose, and you will want
  27. instant access to the MAKEBOOK.EXE program.
  28.  
  29.  
  30.          A STEP BY STEP GUIDE TO CREATING A COOKBOOK
  31.          -------------------------------------------
  32.  
  33. 1.    Create a directory somewhere on your hard disk for the express
  34.     purpose of working on this cookbook.
  35.  
  36. 2.    Use a text editor to create the recipe files that constitute
  37.     your cookbook.
  38.  
  39. 3.    Run the MAKEBOOK.EXE program.
  40.  
  41. 4.    If errors are reported, correct them and return to step (3)
  42.  
  43. 5.    Copy the newly created .DEF and .DAT files to the BOOKS
  44.     directory.
  45.  
  46.  
  47.               THOSE STEPS IN MORE DETAIL
  48.               --------------------------
  49.  
  50. 1. Creating a directory
  51. -----------------------
  52. Since the MAKEBOOK program will operate on every recipe file that it
  53. finds in the current directory, it is good housekeeping practice to
  54. create a sub-directory for every cookbook that you create. A sensible
  55. directory structure might look like this:
  56.  
  57. COOKBOOKS
  58. |
  59. +--INDIAN
  60. |
  61. +--CHINESE
  62. |
  63. +--THAI
  64.  
  65. This shows a parent directory called COOKBOOKS, with sub-directories
  66. called INDIAN, CHINESE and THAI. Each of these three sub-directories
  67. will contain the recipe files that constitute that cookbook. The
  68. MS-DOS command "MD" can be used to create sub-directories.
  69.  
  70.  
  71. 2. USING A TEXT EDITOR TO CREATE RECIPE FILES
  72. ---------------------------------------------
  73. Every recipe in your cookbook is descibed in its own file. These files
  74. are simple ASCII text files that can be created and edited using any
  75. ASCII text editor, such as the MS-DOS "edit" command.
  76.  
  77. Each recipe file can have any name that you like, but MUST have an
  78. extension of ".REC". The recipe files must be formatted in a special
  79. way so that MAKEBOOK can make sense of them. See Appendix (A) for a
  80. full description of the format of a recipe file.
  81.  
  82. If you were creating a cookbook for Indian recipes, you might have the
  83. following recipe files, perhaps contained in a sub-directory called
  84. "INDIAN" (see step (1) above).
  85.  
  86. MADRAS.REC
  87. VINDALOO.REC
  88. BHUNA.REC
  89. TIKKA.REC
  90. RJOSH.REC
  91.  
  92. etc...
  93.  
  94.  
  95. 3. RUNNING THE MAKEBOOK.EXE PROGRAM
  96. -----------------------------------
  97. When you have created the recipes that constitute your cookbook, you
  98. should run the MAKEBOOK program in order to create the cookbook
  99. itself. The syntax of MAKEBOOK is:
  100.  
  101. MAKEBOOK bookname
  102.  
  103. Where "bookname" is the filename of the cookbook that you want to
  104. create. DO NOT supply a file extension for the cookbook -- MAKEBOOK
  105. needs to add its own.
  106.  
  107. If all goes OK then you should see various progress messages appear on
  108. the screen, followed by a request to enter the name of the cookbook.
  109. This is the name that will appear in the "Select cookbook" menu of
  110. Cookbook Manager. Please don't enter a name that is too long,
  111. otherwise it will look ugly inside the menu. 20 characters should be
  112. considered a maximum.
  113.  
  114.  
  115. 4. WHAT TO DO IN THE CASE OF AN ERROR
  116. -------------------------------------
  117. MAKEBOOK will add every .REC file in the current directory to the
  118. cookbook. If an error is encountered during processing then a message
  119. will be printed and MAKEBOOK will abort and return you to the DOS
  120. prompt. You should then attempt to fix the error and re-run MAKEBOOK.
  121. Appendix (B) lists all the errors that MAKEBOOK can produce.
  122.  
  123.  
  124. 5. COPYING THE .DEF AND .DAT FILES
  125. ----------------------------------
  126. The final result of running MAKEBOOK is that two new files are created
  127. in the current directory. They have the extensions of ".DAT" and
  128. ".DEF". The DAT file is the cookbook itself, whilst the .DEF file is a
  129. text file that contains the cookbook details. You should use the DOS
  130. "copy" command (or the Windows File Manager if you're that way
  131. inclined) to copy these files to the BOOKS directory.
  132.  
  133. In case you were unsure, the BOOKS directory can be found within the
  134. directory that contains the COOKBOOK.EXE file. When you run Cookbook
  135. Manager, it searches this directory for cookbooks and adds their names
  136. to the "Select cookbook" menu.
  137.  
  138.  
  139.            APPENDIX A. THE FORMAT OF A RECIPE FILE
  140.            ---------------------------------------
  141. Each recipe file that you create MUST start in the following manner:
  142.  
  143.  
  144. .TYPE
  145. recipe type code
  146. .TITLE
  147. short recipe title
  148. .SHORTDESC
  149. one line recipe description
  150. multi-line description of recipe, giving background, introduction etc.
  151. This section can consist of as many paragraphs as you like, and is
  152. optional. Only the one-line description is mandatory.
  153.  
  154.  
  155. .TYPE
  156. -----
  157. The .TYPE command must be followed by a recipe code that tells
  158. Cookbook Manager what type of recipe this is, and whether or not it is
  159. suitable for vegetarians. This code must appear on its own line, and
  160. should be in upper case text. The possible codes are:
  161.  
  162. M    Main dish
  163. A    Appetizer
  164. B    Bread
  165. L    Beverage
  166. C    Cookie
  167. SL    Salad
  168. SP    Soup
  169. S    Sauce
  170. D    Dessert
  171. O    Other
  172.  
  173. Each of the above codes may have a "V" suffix to indicate that the
  174. recipe is suitable for vegetarians. Some examples are:
  175.  
  176. MV    Main dish, suitable for vegetarians
  177. SL    Salad, not suitable for vegetarians
  178. SPV    Soup, suitable for vegetarians
  179.  
  180.  
  181. .TITLE
  182. ------
  183. Every recipe has a title, and it should follow this command on its own
  184. line. The recipe title must NOT contain spaces, where spaces are
  185. desired it is traditional to use the minus sign ("-") instead. This is
  186. the title that will appear in the Cookbook Manager search dialogue
  187. box.
  188.  
  189.  
  190. .SHORTDESC
  191. ----------
  192. This command should be followed by a one-line short description of the
  193. recipe. This one line description may be followed by as many
  194. paragraphs of recipe description as you like. These paragraphs are not
  195. mandatory, but it is traditional and indeed desirable to provide your
  196. reader with some background to the recipe.
  197.  
  198.  
  199. THE REST OF THE RECIPE FILE
  200. ---------------------------
  201. The rest of the recipe file can just consist of ordinary paragraphs
  202. of text that describe its various aspects. Wherever you want a header,
  203. you should start the line with a period ("."), for example:
  204.  
  205. .INGREDIENTS
  206.  
  207. is a very common header ! If you want some italic text then you should
  208. enclose it in the \IT{text} command. For example:
  209.  
  210. This is \IT{italic} text
  211.  
  212. would produce the word "italic" in italicised text. You cannot have
  213. italic text that runs over more than one line.
  214.  
  215. There are two sections that are present in almost every recipe, these
  216. are the ingredients and procedure sections. For that reason there are
  217. several commands that you can use to aid in their constructions.
  218.  
  219.  
  220. THE INGREDIENTS SECTION
  221. -----------------------
  222. When viewed in Cookbook Manager, an ingredients section might look
  223. like this:
  224.  
  225. 1 pint        Milk (full cream)
  226. 2        eggs
  227.  
  228. In the recipe file, you should write this as:
  229.  
  230. 1 pint{IG}Milk (full cream)
  231. 2{IG}eggs
  232.  
  233. The {IG} command is an instruction to insert a reasonable amount of
  234. space and to format the rest of the line in italics. This produces a
  235. pleasant on-screen format.
  236.  
  237.  
  238. THE PROCEDURE SECTION
  239. ---------------------
  240. You might choose to write your procedure as one or more paragraphs of
  241. descriptive text, this is fine -- a lot of recipes are formatted this
  242. way. However, you might like to itemise each procedure step with a
  243. number. If so, this is how you set it out:
  244.  
  245. {1}
  246. This is step one. Write as many paragraphs as you like.
  247. {2}
  248. This is step two.
  249. {3}
  250. This is step three.
  251.  
  252. The {n} commands instruct Cookbook Manager to indent the following
  253. paragraphs so that they look pleasant on-screen.
  254.  
  255.  
  256. RECOMMENDED FORMAT
  257. ------------------
  258. After the mandatory start to every recipe file, you can include
  259. whatever information you like. However, it is recommended that you
  260. include at least the following sections in your recipe file so that
  261. future versions of Cookbook Manager might make use of them.
  262.  
  263. INGREDIENTS    - Cookbook Manager looks for this when searching for
  264.           ingredients
  265. PROCEDURE    - Cookbook Manager considers this header as the end of
  266.           the ingredients section.
  267. NOTES        - Not yet used, but recommended for inclusion.
  268. CONTRIBUTOR    - Not yet used, but recommended for inclusion.
  269.  
  270.  
  271.               APPENDIX B. ERROR MESSAGES
  272.               --------------------------
  273.  
  274. Cannot create cookbook
  275.     the .DAT file could not be created. Make sure that the filename you
  276.     gave as a parameter to MAKEBOOK is valid, and does not have an
  277.     extension.
  278.  
  279. Cannot open recipe file
  280.     A .REC file was found, but could not be opened for reading. Check
  281.     the file and disk structure, this is an error that should not occur.
  282.  
  283. No recipe files found
  284.     No .REC files were found in the current directory.
  285.  
  286. Cannot create temporary file
  287.     MAKEBOOK needs to use a temporary file, if it could not create one
  288.     then you get this message. Is your disk write protected ?
  289.  
  290. .TYPE code text is the wrong size
  291.     You get this error if the line following the .TYPE command contains
  292.     more than 3 characters of text (the maximum length of a recipe type
  293.     code).
  294.  
  295. recipe title cannot contain spaces
  296.     The single line that follows the .TITLE command cannot contain any
  297.     space characters.
  298.  
  299. .SHORTDESC encountered before .TYPE
  300. .SHORTDESC encountered before .TITLE
  301. mandatory section not present or incomplete
  302.     The recipe file does not conform to the mandatory section described
  303.     in Appendix (A).
  304.  
  305.  
  306. '}' missing (must be on same line as '{')
  307.     \IT{text} command does not have a closing }. The closing } must appear
  308.     on the same line as the {.
  309.  
  310. cannot re-open temporary file
  311.     Very strange error that indicates that the temporary file was created
  312.     OK but could not be re-opened for reading. You should never see this
  313.     error.
  314.  
  315. read failed on temporary file
  316.     The temporary file could be opened OK but then reading it failed.
  317.     You should never see this error.
  318.  
  319. file write error
  320.     Fairly generic error that can occur during any write operation.
  321.     The reason might be that your disk is full.
  322.  
  323. cannot create .DEF file
  324.     The .DEF file could not be opened for writing. You should not
  325.     see this error since its cause is likely to be caught by the
  326.     "cannot open cookbook" error, that appears earlier in the
  327.     execution cycle.
  328.  
  329.  
  330.              APPENDIX C. EXAMPLES
  331.              --------------------
  332. The EXAMPLES directory contains five example recipe files, taken from
  333. "The Cat's Meow" on-line beer-brewing guide. The ".REC" files should
  334. give you a good idea how to create recipe files. If you so wish, you
  335. can use MAKEBOOK in the example directory to create a new cookbook for
  336. viewing with Cookbook Manager.
  337.  
  338.  
  339. FINALLY
  340. -------
  341. There are many on-line collections of recipes available in ASCII
  342. format. Usually these are of a fairly regular structure. Anyone out
  343. there with a degree in Perl or Awk should be able to knock up an
  344. automatic recipe file creator -- any takers ?
  345.  
  346.  
  347. Bon Appetite,
  348.  
  349. Andy Brown (asb@cs.nott.ac.uk)
  350.  
  351. E-mail address expires in July 1994 -- do not use after this date.
  352.